package cn.chengpengper.im.sdk.client.impl;

import cn.chengpengper.im.common.domain.enums.IMTerminalType;
import cn.chengpengper.im.common.domain.model.ImGroupMessage;
import cn.chengpengper.im.common.domain.model.ImPrivateMessage;
import cn.chengpengper.im.sdk.client.ImClient;
import cn.chengpengper.im.sdk.interfaces.sender.ImSender;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class DefaultImClient implements ImClient {

    @Resource
    private ImSender imSender;

    @Override
    public <T> void sendPrivateMessage(ImPrivateMessage<T> message) {
        imSender.sendPrivateMessage(message);
    }

    @Override
    public <T> void sendGroupMessage(ImGroupMessage<T> message) {
        imSender.sendGroupMessage(message);
    }

    @Override
    public Boolean isOnline(Long userId) {
        return imSender.isOnline(userId);
    }

    @Override
    public List<Long> getOnlineUserList(List<Long> userIds) {
        return imSender.getOnlineUser(userIds);
    }

    @Override
    public Map<Long, List<IMTerminalType>> getOnlineTerminal(List<Long> userIds) {
        return imSender.getOnlineTerminal(userIds);
    }
}
